//
//  HealthyInfoModel.m
//  掌上宏力
//
//  Created by admin on 2017/4/28.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "HealthyInfoModel.h"

@implementation HealthyInfoModel

+(HealthyInfoModel *)setHealthyInfoWithDictionary:(NSDictionary *)dic{
    HealthyInfoModel *model = [[HealthyInfoModel alloc] init];
    model.healthyId = dic[@"PE_ID"];
    model.visitId = [NSString stringWithFormat:@"%@",dic[@"PE_VISIT_ID"]];
    model.name = [User currentUser].username;
    
    NSString *dateStr = dic[@"PE_PRE_DATE"];
    NSString *date = [dateStr substringToIndex:(dateStr.length-8)];
    model.date = date;
    
    NSString *resultDateStr = dic[@"LAST_AUDIT_DATE"];
    NSString *resultDate = resultDateStr.length>5? [resultDateStr substringToIndex:(resultDateStr.length-8)] : resultDateStr;
    
    model.resultDate = resultDate;
    model.healthyOperator = dic[@"PE_PRE_OPERATOR"];
    return model;
}

@end
